// /*
//  * @Author: your name
//  * @Date: 2021-07-13 11:22:22
//  * @LastEditTime: 2021-08-03 00:31:11
//  * @LastEditors: Please set LastEditors
//  * @Description: In User Settings Edit
//  * @FilePath: \hrsaas\src\main.js
//  */
// import Vue from 'vue'

// import 'normalize.css/normalize.css' // A modern alternative to CSS resets

// import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

// import '@/styles/index.scss' // global css

// import App from './App'
// import store from './store'
// import router from './router'
// import Component from '@/components'
// import * as directives from '@/directives'
// import '@/icons' // icon
// import '@/permission' // permission control
// import il8n from '@/lang/index'
// import checkPermission from './mixin/checkPermission'
// // 引入过滤器
// import * as filters from '@/filters'

// Object.keys(filters).forEach(key => {
//   // 注册自定义过滤器
//   Vue.filter(key, filters[key])
// })
// Object.keys(directives).forEach(key => {
//   // 注册自定义指令
//   Vue.directive(key, directives[key])
// })
// // 注册自定义指令
// Vue.use(Component)
// // set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// // 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI, {
//   i18n: (key, value) => il8n.t(key, value)

// })

// // 混入检测注册
// Vue.mixin(checkPermission)

// Vue.config.productionTip = false

// new Vue({
//   el: '#app',
//   router,
//   store,
//   il8n,
//   render: h => h(App)
// })

import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'
// 注册自定义指令
import * as directives from '@/directives'
import '@/icons' // icon
import '@/permission' // permission control
import component from '@/components'
import * as filters from './filters'
import checkPermission from '@/mixin/checkPermission'
import i18n from '@/lang'
// 遍历所有的导出的指令对象 完成自定义全局注册
Object.keys(directives).forEach(key => {
  // 注册自定义指令
  Vue.directive(key, directives[key])
})
// 设置element为当前的语言
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
// 注册过滤器
Object.keys(filters).forEach(key => Vue.filter(key, filters[key]))
Vue.use(component) // 注册自己的组件
Vue.use(ElementUI, { locale })
Vue.mixin(checkPermission)
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
